extends "../junzhu-2/junzhu-2.gd"


func _extInit():
	._extInit()
	lv = 3             #等级的设置
	addSkill("每{cd}秒随机弱驱散4名敌方单位身上的增益效果,并恢复[驱散增益数量*最大生命值*1.5%]血量", "君王睥睨", "junzhu3", 8)
var p31 = 4
var p32 = 1
func _castCdSkill(id):
	._castCdSkill(id)
	if id == "junzhu3":
		junzhu3()

func junzhu3():
	utils.createSkillTextEff("君王睥睨", position)
	var buffNum = 0
	var chas = getAllChas(1)
	chas.shuffle()
	var num = []
	for i in chas:
		if num.size() >= p31:
			break
		var buffs = i.buffs
		for j in buffs:
			if not j.isNegetive and isWeakBuff(j):
				j.isDel = true
				buffNum += 1
				if not num.has(i):
					num.append(i)
	if buffNum > 0:
		healCha(self, buffNum * att.maxHp * 0.015 * p32)